# mix this class into a model to get extra functionality
module ModelHelpers
    
    def self.included(base)
        base.class_eval do
            
        end
        # base.extend(ClassMethods)
    end
    
    module ClassMethods
        
        # put any class methods here
        
    end    
    
    public
    
    ###############################################
    # Adds errors from the model into the current
    # objects errors.  Returns false if no errors were
    # found.  True if errors were found.
    def process_errors(record, error_array)
        if record.errors.length > 0
            record.errors.each do |error_key, error_msg|
                error_array.push(error_msg)
            end
            return true
        else
            return false
        end
    end
    
end



